home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 15 October 1998
- // Author: mt
- //
- // Procedure Name:
- // AniCharactersMenu
- //
- // Description:
- // Create the character menu
- //
- // Input Arguments:
- // parent to parent the menu to
- //
- // Return Value:
- // None.
- //
-
-
- global proc AniCharactersMenu( string $parent )
- {
- setParent -m $parent;
- if( `menu -q -ni $parent` != 0 ) {
- //
- // Menu is built already - just return
- //
- return;
- }
-
- menuItem -l "Create Character Set"
- -annotation "Create Character Set: Attributes on the selected objects will be placed in a character set"
- -c "CreateCharacter"
- -dragMenuCommand "performCreateCharacter 2"
- createCharacterItem;
- menuItem -optionBox true
- -annotation "Create Character Set Option Box"
- -l "Create Character Set Option Box"
- -c "CreateCharacterOptions"
- createCharacterDialogItem;
- menuItem -l "Create Subcharacter Set"
- -annotation "Create Subcharacter Set: Make highlighted channel box items a subcharacter of the current character"
- -c "performCreateSubcharacter 0"
- -dragMenuCommand "performCreateSubcharacter 2"
- createSubCharacterItem;
- menuItem -optionBox true
- -annotation "Create Subcharacter Set Option Box"
- -l "Create Subcharacter Set Option Box"
- -c "performCreateSubcharacter 1"
- createSubCharacterDialogItem;
-
- menuItem -l "Attribute Editor..."
- -annotation "Attribute Editor: Edit values of attributes in the character set"
- -command "EditCharacterAttributes"
- editCharacterAttributesItem;
-
- menuItem -d true;
-
- menuItem -l "Add to Character Set"
- -annotation "Add to Character Set: Add highlighted channel box items to current character set"
- -c "doEditCharacterArgList 1 { \"1\" }"
- addCharacterItem;
- menuItem -l "Remove from Character Set"
- -annotation "Remove from Character Set: Remove highlighted channel box items from current character set"
- -c "doEditCharacterArgList 1 { \"0\" }"
- removeCharacterItem;
- menuItem -l "Merge Character Sets"
- -annotation "Merge Character Sets: Combine the selected characters into a single character set"
- -c "mergeCharacters"
- mergeCharacterItem;
-
- menuItem -divider true;
-
-
- menuItem -l "Select Character Set Node" -sm true -aob true
- selectCharSMItem;
- menu -e -pmc "createSelectCharMenu selectCharSMItem"
- selectCharSMItem;
- setParent -m ..;
- menuItem -l "Select Character Set Members" -sm true -aob true
- selectCharNodesSMItem;
- menu -e -pmc "createSelectCharNodesMenu selectCharNodesSMItem"
- selectCharNodesSMItem;
- setParent -m ..;
- menuItem -l "Set Current Character Set" -sm true setCharSMItem;
- menu -e -pmc "buildSetCharacterMenu setCharSMItem" setCharSMItem;
- setParent -m ..;
-
- setParent -m ..;
- }
-
- //
- // Procedure Name:
- // selectNodesInCharacter
- //
- // Description:
- // Select all of the nodes in a particular character. Note that
- // this method adds to the selection, and does not replace it. Do
- // a "select -cl" before calling this method if you wish to replace
- // the current selection.
- //
- // Input Arguments:
- // $character - character who's nodes we are to select
- //
- // Return Value:
- // None
- //
- global proc selectNodesInCharacter( string $character )
- {
- string $list[] = `sets -nodesOnly -query $character`;
- for ( $item in $list ) {
- if ( "character" == `nodeType $item` ) {
- selectNodesInCharacter( $item );
- } else {
- select -add $item;
- }
- }
- }
-
- //
- // Procedure Name:
- // createSelectCharNodesMenu
- //
- // Description:
- // Create the menu for selecting all of the nodes in
- // a particular character.
- //
- // Input Arguments:
- // $parent - parent menu
- //
- // Return Value:
- // None
- //
- global proc createSelectCharNodesMenu( string $parent ) {
- setParent -m $parent;
- menu -e -dai $parent;
-
- // Get characters in system
- //
- string $characters[] = `ls -type character`;
-
- if( `size $characters` == 0 ) {
- menuItem -l "No Character Sets Defined" -enable false;
- } else {
- string $cmd;
- string $annotation;
- for( $character in $characters ) {
- $cmd = ( "select -cl;selectNodesInCharacter( \"" + $character + "\" )" );
- $annotation = ( "Select all of the nodes that are a part of " +
- $character );
- menuItem -l $character -c $cmd -annotation $annotation;
- }
- }
- }
-
- //
- // Procedure Name:
- // createSelectCharMenu
- //
- // Description:
- // Create the menu for selecting characters quickly
- //
- // Input Arguments:
- // $parent - parent menu
- //
- // Return Value:
- // None
- //
- global proc createSelectCharMenu( string $parent ) {
- setParent -m $parent;
- menu -e -dai $parent;
-
- // Get characters in system
- //
- string $characters[] = `ls -type character`;
-
- if( `size $characters` == 0 ) {
- menuItem -l "No Character Sets Defined" -enable false;
- } else {
- string $cmd;
- string $annotation;
- for( $character in $characters ) {
- $cmd = ( "select -r \"" + $character + "\"" );
- $annotation = ( "Select " + $character );
- menuItem -l $character -c $cmd -annotation $annotation;
- }
- }
- }
-
-
-